import Login from "../page/Login";
import Article from "../page/Article";
import Layout from "../page/Layout";
import About from "../page/About/index.tsx";
import Board from "../page/Board";
import NotFount from "../page/NotFound";
import { AuthRoute } from "@/components/AuthRoute";

import { createBrowserRouter } from "react-router-dom";
const router = createBrowserRouter([
  {
    path: "/login",
    element: <Login></Login>,
  },
  {
    path: "/article",
    element: <Article></Article>,
  },
  {
    path: "/board",
    element: <Board></Board>,
  },
  {
    path: "/", //这个渲染Layout组件
    element:AuthRoute(<Layout />) ,
    children: [
      {
        path: "/about",
        element: <About />,
      },
      {
        // path: "/board",
        index:true,
        element: <Board />,
      },
    ],
  },
//   404
{
    path:"*",
    element:<NotFount/>
}
]);

export default router;
